import request from '@/utils/request'

/* 获取员工列表 */
export function getList(params) {
  return request({
    url: '/users',
    method: 'get',
    params
  })
}

/* 新增员工 */
export function addEmployees(data) {
  return request({
    url: '/auth/local/register',
    method: 'post',
    data
  })
}

/* 删除员工 */
export function delEmployees(id) {
  return request({
    url: '/users/' + id,
    method: 'delete'
  })
}

/* 回显员工数据 */
export function EmployeesDetails(id) {
  return request({
    url: '/users/' + id
  })
}

/* 编辑员工 */
export function editEmployees(data) {
  return request({
    url: '/users/' + data.id,
    method: 'put',
    data
  })
}

/* 获取用户数量 */
export function EmployeesNum() {
  return request({
    url: '/users/count'
  })
}
